WDV221 Intro Javascript

Shipping Calculation Project

Calculate Your Order

Select Product:
Quantity:
Shipping State (Tax Purposes):
Delivery Method:
Your Total is:

Project Instructions:

  1. Create a function called getShipping that is called when you click the "Calculate My Order Now" button.
  2. When a product is selected the function should get the price from the selected product and store it in a local variable.
  3. Take the quantity entered on the form and store it in a local variable.
  4. Calculate a salesTotal using price * quantity.
  5. When the taxing state is selected, determine the tax rate based upon the selected state.
  6. Calculate the tax amount on the sales total. Store the tax amount in a local variable.
  7. When the Delivery Method is selected the function should get the delivery fee percentage from the selected Delivery method.
  8. Determine the shipping cost based upon the selected shipping method.
  9. Determine the total bill by adding the sales total, tax amount, shipping cost and place it the total field.
  10. Format the total amount by using a dollar format function.